<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@  taglib  uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="Css/style.css" />
    <script type="text/javascript" src="Js/jquery.js"></script>
    <script type="text/javascript" src="Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="Js/bootstrap.js"></script>
    <script type="text/javascript" src="Js/ckform.js"></script>
    <script type="text/javascript" src="Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form action="editRole" method="post" class="definewidth m20" >
<input type="hidden"  name="roleId" value="${role.roleId }">
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft"><font color="red">*</font>角色名称</td>
        <td><input type="text" name="roleName" value="${role.roleName }"/></td>
    </tr>
    <tr>
        <td class="tableleft"><font color="red">*</font>状态</td>
        <td>
        	<c:if test="${role.roleState == 0 }">
        		  <input type="radio" name="roleState" value="0" checked /> 启用
         		  <input type="radio" name="roleState" value="1"  /> 禁用
        	</c:if>
        	
        	<c:if test="${role.roleState != 0 }">
        		  <input type="radio" name="roleState" value="0" /> 启用
         		  <input type="radio" name="roleState" value="1" checked  /> 禁用
        	</c:if>
         
        </td>
    </tr>
    <tr>
        <td class="tableleft"><font color="red">*</font>权限</td>
        <td>
        		<c:forEach var="m" items="${menus }" >
        				<c:if test="${m.menuIsok != 1 }">
	        				<ul><label class='checkbox inline'><input type='checkbox' name='menuIds' value='${m.menuId }' />${m.menuName }</label></ul> 
        				</c:if>
        				<c:if test="${m.menuIsok == 1 }">
	        				<ul><label class='checkbox inline'><input type='checkbox' name='menuIds'  checked="checked"  value='${m.menuId }' />${m.menuName }</label></ul> 
        				</c:if>
        		</c:forEach>
				<!-- <ul><label class='checkbox inline'><input type='checkbox' name='group[]' value='' />书籍管理</label></ul> 
                <ul><label class='checkbox inline'><input type='checkbox' checked="checked" name='group[]' value='' />用户管理</label></ul> 
                <ul><label class='checkbox inline'><input type='checkbox' name='group[]' value='' />角色管理</label></ul> 
                <ul><label class='checkbox inline'><input type='checkbox' checked="checked" name='group[]' value='' />菜单管理</label></ul> 
                <ul><label class='checkbox inline'><input type='checkbox' name='group[]' value='' />密码管理</label></ul>  -->
		</td>
    </tr>
    <tr>
        <td class="tableleft"></td>
        <td>
            <button type="submit" class="btn btn-primary" type="button">更新</button> &nbsp;&nbsp;<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
        </td>
    </tr>
</table>
</form>
</body>
</html>
<script>
    $(function () {
        $(':checkbox[name="group[]"]').click(function () {
            $(':checkbox', $(this).closest('li')).prop('checked', this.checked);
        });

		$('#backid').click(function(){
				window.location.href="index.html";
		 });

    });
</script>